﻿using JinJun.EF.Permission.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.SessionState;

namespace JinJun.EF.Permission.Web.Models
{
    public class AdminUserContext //管理下上文类
    {   
        
        /// <summary>
        /// 静态上下文类
        /// </summary>
        public static AdminUserContext adminContext = new AdminUserContext();

        //会话的key
        private string SessionKey = "ADMININFO_KEY";

        //会话状态
        public HttpSessionState httpSessionState => HttpContext.Current.Session;
        
        //管理信息
        public AdminUser AdminUser
        {
            get {
              return  httpSessionState[SessionKey] as AdminUser;
            }
            set {
                httpSessionState[SessionKey]=value;
            }
        }
    }
}